function priceTS = return2priceTS(retTS,init_price)
% priceTS = return2priceTS(retTS)  Calculate prices from a (log) return time series
% (priceTS = exp(cumsum(retTS))*init_price')  
% ignores returns on first date

if nargin < 2; init_price = 100*ones(size(retTS.header)); end

priceTS = buildTS(retTS);
priceTS.data(1,:) = init_price; % first date init_price
priceTS.data(2:end,:) = exp(cumsum(retTS.data(2:end,:))).*repmat(init_price,length(retTS.dates)-1,1);

return
